package org.zjsru.springclouddemo5418.Poke;

import java.util.ArrayList;
import java.util.Collections;

public class Deck {
    private ArrayList<Card> cards;

    public Deck() {
        cards = new ArrayList<>();
        String[] suits = {"♠", "♥", "♣", "♦"};
        for (String suit : suits) {
            for (int value = 2; value <= 14; value++) { // 2-10, J=11, Q=12, K=13, A=14
                cards.add(new Card(suit, value));
            }
        }
    }

    public void shuffle() {
        Collections.shuffle(cards);
    }

    public Card drawCard() {
        return cards.remove(0);
    }
}